// src/types/document.ts
export interface DatasourceConnection {
  dbType: string
  host: string
  port: number
  database: string
  username: string
  password: string
}

export interface TaskCreateRequest {
  connection?: DatasourceConnection
  sqlContent?: string
}

export interface DocumentTask {
  id: number
  taskId: string
  userId?: number
  taskName: string
  dbType: string
  status: 'processing' | 'success' | 'failed'
  isPublic: boolean
  errorMessage?: string
  createdAt: string
  updatedAt: string
}

export interface Table {
  name: string
  comment: string
  type: string
  columns: Column[]
}

export interface Column {
  name: string
  type: string
  size: number
  decimalDigits: number
  nullable: boolean
  primaryKey: boolean
  defaultValue: string
  comment: string
  autoIncrement: boolean
}
